package com.lkd.feign.fallback;

import com.lkd.feign.OrderServiceFeignClient;
import com.lkd.vo.PayVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

@Slf4j
@Component
public class OrderServiceFallbackFactory implements FallbackFactory<OrderServiceFeignClient> {
    @Override
    public OrderServiceFeignClient create(Throwable throwable) {
        log.error("throwable={}",throwable);
        return new OrderServiceFeignClient() {
            @Override
            public Map<String, String> requestPay(PayVO payVO) {
                return null;
            }
        };
    }
}
